@extends('admin/layout/main')

@section('content')
    <a href="{{ url('admin/admin/create') }}" class="btn btn-primary" style="float:right;margin-bottom:20px">添加</a>
    <table class="table table-hover">
        <tr>
            <th>管理员姓名</th>
            <th>管理员邮件</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        @foreach($list as $key => $item)
            <tr>
                <td>{{ $item->name }}</td>
                <td>{{ $item->email }}</td>
                <td>{{ $item->created_at }}</td>
                <td>
                    <button type="button" class="btn btn-default" aria-label="Left Align" onclick="location.href='{{ url('admin/admin/edit/' . $item->id) }}'">
                        <span class="glyphicon glyphicon glyphicon-pencil" aria-hidden="true"></span>
                    </button>

                    <button type="button" class="btn btn-default" aria-label="Left Align" onclick="location.href='{{ url('admin/admin/destroy/' . $item->id) }}'">
                        <span class="glyphicon glyphicon glyphicon-trash" aria-hidden="true"></span>
                    </button>
                </td>
            </tr>
        @endforeach
    </table>
    <?php echo $list->render(); ?>
@endsection